import java.util.Random;
import java.util.Scanner;
import java.util.StringJoiner;

public class App {
    public static void main(String[] args) throws Exception {
        //变量初始化
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        StringJoiner sj1 = new StringJoiner(",","[","]");
        StringJoiner sj2 = new StringJoiner("、","(",")");
        int num = 0;
        int i = 0;
        int limit = 0;
        char ch = '0';
        String str1 = new String();

        limit = r.nextInt(6) + 3;//元素个数
        for( ;limit != 0;limit--)
        {
            str1 = "";//将字符串初始化
            num = r.nextInt(5) + 2;//该元素的字符数
            for( ;num != 0;num--)
            {
                i = r.nextInt(2);//该字符的大小写情况
                ch = (i == 1)?(char)(r.nextInt(26) + 65):(char)(r.nextInt(26) + 97);//具体字母
                str1 += ch;//拼接字母
            }
            sj1.add(str1);//拼接该元素
        }
        //输出
        check(sj1);
        sj2.add("BYG").add("jio");
        check(sj1.merge(sj2));
        System.out.printf("str.length = %d\n\n",sj1.merge(sj2).length());
    }

    public static String check(StringJoiner sj)//打印StringJoiner的内容
    {
        String str = new String();
        str = sj.toString();
        System.out.printf("\nstr = " + str + "\n\n");
        return str;
    }
}
